package com.kczd.jinlan.adapter.normaladapter;

import android.content.Context;
import android.widget.ImageView;
import android.widget.TextView;

import com.kczd.jinlan.R;
import com.kczd.jinlan.model.Classify;
import com.kczd.jinlan.utils.PhotoUtils;

import java.util.List;

/**
 * zhangy
 * Created by Administrator on 2017/5/15.
 */

public class ClassifyAdapter extends BaseCommAdapter<Classify> {

    public ClassifyAdapter(List<Classify> datas) {
        super(datas);
    }
    @Override
    protected void setUI(ViewHolder holder, int position, Context context) {
        Classify item = getItem(position);

        TextView tv_name = holder.getItemView(R.id.mine_text);
        tv_name.setText(item.name);
        ImageView iv_head = holder.getItemView(R.id.mine_img);
        iv_head.setImageBitmap(PhotoUtils.convertStringToIcon(item.image));
    }

    @Override
    protected int getLayoutId() {
        return R.layout.classify_item;
    }
}
